

jQuery(document).ready(function()
{
	
//	alert("si");
	console.log("iniciando script de transition .l.");

	
	$.ajax({
		url : 'getEstatus', // action to be perform
		dataType : 'html',
		success : function(html) {
			$('#contC').html(html); // set result.jsp output to leftDiv
		},
		error : function(xhr, ajaxOptions, thrownError) {
			alert('An error occurred! ' + thrownError);
		},
	});
	
	
	$.ajax({
		url : 'getOP', // action to be perform
		dataType : 'html',
		success : function(html) {
			$('#operationsInformation').html(html); // set result.jsp output to leftDiv
		},
		error : function(xhr, ajaxOptions, thrownError) {
			alert('An error occurred! ' + thrownError);
		},
	});

	
	
	$.ajax({
		url : 'getRequirements', // action to be perform
		dataType : 'html',
		success : function(html) {
			$('#requirements').html(html); // set result.jsp output to leftDiv
		},
		error : function(xhr, ajaxOptions, thrownError) {
			alert('An error occurred! ' + thrownError);
		},
	});
	
	$.ajax({
		url : 'getLog', // action to be perform
		dataType : 'html',
		success : function(html) {
			$('#log').html(html); // set result.jsp output to leftDiv
		},
		error : function(xhr, ajaxOptions, thrownError) {
			alert('An error occurred! ' + thrownError);
		},
	});
	
		$.ajax({
			url : 'sendComment', // action to be perform 
			type : 'POST',
			data : {
				newCommnet : $("#insert_comment").val()
			},
			dataType : 'html',
			success : function(html) {
				
				$('#addComment').html(html);
			},
			error : function(xhr, ajaxOptions, thrownError) {
				alert('An error occurred! ' + thrownError);
			},
		});


	


});

var addExist = function() {

	$.ajax({
		url : 'addPerson', // action to be perform 
		type : 'POST',
		data : {
			idInsertPersonExist : $("#personIds").val()
		},
		dataType : 'html',
		success : function(html) {
			llenarTabla();
			llamadoLog();
			 $('#addP').bPopup().close();
		},
		error : function(xhr, ajaxOptions, thrownError) {
			alert('An error occurred! ' + thrownError);
		},
	});
}

var agregarPersona = function() {

	$.ajax({
		url : 'listOptions', // action to be perform 
		type : 'POST',
//		data : {
//			newCommnet : $("#insert_comment").val()
//		},
		dataType : 'html',
		success : function(html) {
			
			$('#addP').html(html);
		},
		error : function(xhr, ajaxOptions, thrownError) {
			alert('An error occurred! ' + thrownError);
		},
	});
	 $('#addP').bPopup();
};


var agregarPersonaExistente = function() {

	 $('#addPNew').bPopup();
};


var insertNewPerson = function() {
	$.ajax({
		url : 'ActionvalidarNamePTList', // action to be perform 
		type : 'POST',
		data : {
			addNewPersonalBF : $("#inputBF").val(),
			addNewPersonalName : $("#inputName").val(),
			addNePersonalEmal : $("#inputEmail").val(),
			addNewPersonalTelephone : $("#inputTelephone").val()
		},
		dataType : 'html',
		success : function(html) {
			llenarTabla();
			llamadoLog();
			 $('#addPNew').bPopup().close();
		},
		error : function(xhr, ajaxOptions, thrownError) {
			alert('An error occurred! ' + thrownError);
		},
	});
	


};

var notifyStatus = function() {

	$.ajax({
		url : 'notifyStatus', // action to be perform 
		type : 'POST',
//		data : {
//			newCommnet : $("#insert_comment").val()
//		},
		dataType : 'html',
		success : function(html) {
			alert("se ha realizado la notificacion")
		},
		error : function(xhr, ajaxOptions, thrownError) {
			alert('An error occurred! ' + thrownError);
		},
	});
}
